@layout('layouts/app')

@section('body')
  <div class="settings-page">
      <div class="container page">
          <div class="row">

              <div class="col-md-6 offset-md-3 col-xs-12">
                  <h1 class="text-xs-center">Your Settings</h1>

                  {{-- 此处显示所有的错误信息 --}}
                  @if(flashMessages.has('errors'))
                    <ul class="error-messages">
                        @each(error in flashMessages.all().errors)
                          <li>{{ error }}</li>
                        @end
                    </ul>
                  @endif

                  <form action="{{ route('profile.update', {}, { qs: { _method: 'PATCH' } }) }}" method="POST">
                      <fieldset>
                          <fieldset class="form-group">
                              <input aria-label="URL of profile picture" value="{{ profile.avatar }}" class="form-control" id="avatar" name="avatar" type="url" placeholder="URL of profile picture">
                          </fieldset>
                          <fieldset class="form-group">
                              <input aria-label="your name" value="{{ profile.name }}" class="form-control form-control-lg" name="name" id="name" type="text" placeholder="Your Name">
                          </fieldset>
                          <fieldset class="form-group">
                              <textarea aria-label="short bio about you" name="bio" id="bio" class="form-control form-control-lg" rows="8"
                                        placeholder="Short bio about you">{{ profile.bio }}</textarea>
                          </fieldset>
                          <fieldset class="form-group">
                              <input aria-label="email" class="form-control form-control-lg" type="text" name="email" id="email" value="{{ profile.user.email }}" placeholder="Email">
                          </fieldset>
                          <fieldset class="form-group">
                              <input aria-label="new password" class="form-control form-control-lg" type="password" id="password" name="password" placeholder="New Password">
                          </fieldset>
                          <button class="btn btn-lg btn-primary pull-xs-right" type="submit">
                              Update Settings
                          </button>
                      </fieldset>
                  </form>

                  <hr />

                  @buttonTo({ path: route('sessions.destroy'), class: "btn btn-outline-danger", method: "DELETE" })
                    Or click here to logout.
                  @end
              </div>

          </div>
      </div>
  </div>
@end
